package com.heima.controller;

import com.itcast.aliyunossspringbootautoconfigure.AliOSSUtils;
import com.itcast.qiniuossspringbootautoconfigure.QiniuOssUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import java.io.IOException;

@RestController
@RequestMapping("/api/vm-service")
public class CommonController {
    /**
     * 阿里 七牛上传
     */
    @Autowired
  private AliOSSUtils aliOSSUtils;
//    private QiniuOssUtil qiniuOssUtil;

    @PostMapping("/sku/fileUpload")
    public String upload(MultipartFile fileName) throws IOException {
        String upload = aliOSSUtils.upload(fileName);
        return upload;
    }
}
